<page-header title="产品目录" [breadcrumb]="breadcrumb" [action]="action">
    <ng-template #breadcrumb>
        <ql-breadcrumb>
            <ql-breadcrumb-item>产品管理</ql-breadcrumb-item>
            <ql-breadcrumb-item>产品目录</ql-breadcrumb-item>
        </ql-breadcrumb>
    </ng-template>
    <ng-template #action>
        <!--<ql-button type="primary" [routerLink]="['/product/product-create']">新建产品</ql-button>-->
    </ng-template>
</page-header>

<page-container>
    <div ql-row type="flex">
        <ql-tree (modelChange)="onCatalogChange($event)" [accordion]="true" [model]="catalogList" ql-col span="6"></ql-tree>
        <data-table ql-col span="18" [model]="productList" [cursor]="cursorService"
                    (cursor-change)="onRefresh()">
            <ql-table-column model-key="productname" label="产品名称"></ql-table-column>
            <ql-table-column model-key="productcode" label="产品代码"></ql-table-column>
            <ql-table-column model-key="productcategory" label="产品类别">
              <ng-template #slot let-scope="scope">
                {{scope.rowData.productcategory | dict:'risk_level'}}
              </ng-template>
            </ql-table-column>
            <ql-table-column model-key="risklevel" label="风险等级">
              <ng-template #slot let-scope="scope">
                {{scope.rowData.risklevel | dict:'product_category'}}
              </ng-template>
            </ql-table-column>
            <ql-table-column model-key="recommandtype" label="推荐类别">
              <ng-template #slot let-scope="scope">
                {{scope.rowData.recommandtype | dict:'recommand_type'}}
              </ng-template>
            </ql-table-column>
            <ql-table-column model-key="expiredate" label="停售时间"></ql-table-column>
            <ql-table-column model-key="productprofit" label="产品利率"></ql-table-column>
            <ql-table-column label="操作" width="250px">
                <ng-template #slot let-scope="scope">
                    <ql-button type="text" (click)="foucus(scope.rowData)">关注</ql-button>
                    <!--<ql-button type="text" (click)="delFun()">删除</ql-button>-->
                    <!--<ql-button type="text" [routerLink]="['/product/product-create', { id: scope.rowData.id }]">修改</ql-button>-->
                    <ql-button type="text" [routerLink]="['/product/product-detail', { id: scope.rowData.productNo }]">查看详情</ql-button>
                </ng-template>
            </ql-table-column>
        </data-table>
    </div>
</page-container>
